#include "StdAfx.h"
#include "ExampleDcmOphiesCallback.h"
#include "Ophies.h"


#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif


ExampleDcmStudiesCallback gStudiesCallback(0);
ExampleDcmSeriesCallback gSeriesCallback(0);
ExampleDcmInstancesCallback gInstancesCallback(0);
ExampleDocsetsCallback gDocsetsCallback(0);
ExamplePatientsCallback gPatientsCallback(0);

//////////////////////////////////////////////////////////////////////////
//
// [1] class ExampleDcmStudiesCallback
//
//////////////////////////////////////////////////////////////////////////
ExampleDcmStudiesCallback::ExampleDcmStudiesCallback(COphies* pParent)
{
	m_pParent = pParent;
}

ExampleDcmStudiesCallback::~ExampleDcmStudiesCallback()
{
	m_pParent = NULL;
}

void ExampleDcmStudiesCallback::onListReceived(QList<ophies::DataModel*>* list)
{
	if( m_pParent != NULL )
		m_pParent->ResultCallBack( list );
}

void ExampleDcmStudiesCallback::onObjectReceived(ophies::DataModel* object)
{
	QString uid = ((DcmStudy*) object)->get_study_instance_uid();
}


//////////////////////////////////////////////////////////////////////////
//
// [2] class ExampleDcmSeriesCallback
//
//////////////////////////////////////////////////////////////////////////
ExampleDcmSeriesCallback::ExampleDcmSeriesCallback(COphies* pParent)
{
	m_pParent = pParent;
}

ExampleDcmSeriesCallback::~ExampleDcmSeriesCallback()
{
	m_pParent = NULL;
}

void ExampleDcmSeriesCallback::onListReceived(QList<ophies::DataModel*>* list)
{
	if( m_pParent != NULL )
		m_pParent->ResultCallBack( list );
}

void ExampleDcmSeriesCallback::onObjectReceived(ophies::DataModel* object)
{

}


//////////////////////////////////////////////////////////////////////////
//
// [3] class ExampleDcmInstanceCallback
//
//////////////////////////////////////////////////////////////////////////
ExampleDcmInstancesCallback::ExampleDcmInstancesCallback(COphies* pParent)
{
	m_pParent = pParent;
}

ExampleDcmInstancesCallback::~ExampleDcmInstancesCallback()
{
	m_pParent = NULL;
}

void ExampleDcmInstancesCallback::onListReceived(QList<ophies::DataModel*>* list)
{
	if( m_pParent != NULL )
		m_pParent->ResultCallBack( list );
}

void ExampleDcmInstancesCallback::onObjectReceived(ophies::DataModel* object)
{

}

//////////////////////////////////////////////////////////////////////////
//
// [4] class ExampleDocsetsCallback
//
//////////////////////////////////////////////////////////////////////////
ExampleDocsetsCallback::ExampleDocsetsCallback(COphies* pParent)
{
	m_pParent = pParent;
}

ExampleDocsetsCallback::~ExampleDocsetsCallback()
{
	m_pParent = NULL;
}

void ExampleDocsetsCallback::onListReceived(QList<ophies::DataModel*>* list)
{
	if( m_pParent != NULL )
		m_pParent->ResultCallBack( list );
}

void ExampleDocsetsCallback::onObjectReceived(ophies::DataModel* object)
{

}

//////////////////////////////////////////////////////////////////////////
//
// [5] class ExamplePatientsCallback
//
//////////////////////////////////////////////////////////////////////////
ExamplePatientsCallback::ExamplePatientsCallback(COphies* pParent)
{
	m_pParent = pParent;
}

ExamplePatientsCallback::~ExamplePatientsCallback()
{
	m_pParent = NULL;
}

void ExamplePatientsCallback::onListReceived(QList<ophies::DataModel*>* list)
{
	if( m_pParent != NULL )
		m_pParent->ResultCallBack( list );
}

void ExamplePatientsCallback::onObjectReceived(ophies::DataModel* object)
{
}
